import os
from apscheduler.schedulers.blocking import BlockingScheduler
from datetime import datetime, date


def execute():
    # os.system('python t_datetime.py')
    os.system('python 172_read.py')


scheduler = BlockingScheduler()
# 在某个时间点执行一次
# scheduler.add_job(execute, 'date', run_date=datetime(2022, 3, 16, 17, 13, 30))

# 每隔N时间执行一次。为了演示的更直观，就用这个每隔两秒运行一次
scheduler.add_job(execute, 'interval', seconds=1200)
# scheduler.add_job(execute, 'cron', hour="6-22", minute="10")

# 特定时间内，周期性触发
# scheduler.add_job(execute, 'cron', day_of_week='0-6', hour=17, minute=21)
scheduler.start()
